//
//  ZYCHistoryVersionCell.m
//  ZDSC
//
//  Created by ZDTX on 2021/7/26.
//

#import "ZYCHistoryVersionCell.h"
@interface ZYCHistoryVersionCell ()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *contentLabel;
@property (nonatomic, strong) UIImageView *arrowImageView;

@end
@implementation ZYCHistoryVersionCell

- (void)setDict:(NSDictionary *)dict{
    _dict = dict;
    _titleLabel.text = dict[@"title"];
    _contentLabel.text = dict[@"content"];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.contentLabel];
        [self.contentView addSubview:self.arrowImageView];
    
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(15.0f);
            make.top.equalTo(self.contentView).offset(11.0f);
        }];
        
        [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(15.0f);
            make.bottom.equalTo(self.contentView).offset(-11.0f);
        }];

        [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self.contentView).offset(-15.0f);
            make.centerY.equalTo(self.contentView);
            make.size.mas_equalTo(CGSizeMake(9, 16));
        }];
        

    }
    return self;
}

- (UIImageView *)arrowImageView {
    if (!_arrowImageView) {
        _arrowImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"jt"]];
    }
    return _arrowImageView;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Regular", 16.0f) titleColor:HEX_RGB(@"#2D2D2D") textAlignment:ZZTextAlignmentLeft];
    }
    return _titleLabel;
}

- (UILabel *)contentLabel {
    if (!_contentLabel) {
        _contentLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Regular", 16.0f) titleColor:HEX_RGB(@"#999999") textAlignment:ZZTextAlignmentLeft];
    }
    return _contentLabel;
}

@end
